<ion-view view-title="客户名录" cache-view="true">
  <ion-nav-buttons side="left">
    <button class="button button-icon" ng-click="sortMenu.show($event)">
      <div class="icon ion-navicon positive"></div>
    </button>
  </ion-nav-buttons>
  <ion-nav-buttons side="right">
    <button class="button button-icon" ng-click="createCustomer()">
      <div class="icon ion-android-add positive"></div>
    </button>
  </ion-nav-buttons>
  <ion-content>
    <ion-list>
      <div class="bar bar-header item-input-inset">
        <label class="item-input-wrapper">
          <i class="icon ion-ios-search placeholder-icon"></i>
          <input type="search" placeholder="搜索" ng-model="keyword">
        </label>
      </div>
      <ion-item class="item-remove-animate normal-list-height"
                collection-repeat="customer in customers | filter:keyword" ng-click="previewCustomer(customer);">
        <div>
          <label class="size16">{{customer.cname}}</label>
          <label class="size12">{{customer.company}}</label>
        </div>

        <label ng-if="customer.userid!=customer.toUserId" class="size10 gray">来自{{customer.cOwner}}的分享</label>
        <label ng-if="customer.userid==customer.toUserId" class="size10 gray">&nbsp;</label>
        <ion-option-button class="button-balanced center" ng-click="showLocation(customer)">
          <label>位置</label>
        </ion-option-button>
        <ion-option-button class="button-assertive center" ng-click="phoneCall(customer.phone)">
          <label>手机</label>
        </ion-option-button>
        <ion-option-button class="button-positive center" ng-click="phoneCall(customer.tel)">
          <label>座机</label>
        </ion-option-button>
      </ion-item>
    </ion-list>
  </ion-content>
</ion-view>
